<!-- 模块排名 -->
<template>
  <div class="model_ranking">
    <div class="model_top">
      <div class="model_s model_bt1">
        <div class="isshowdesgin" @click="ShowDetails(1)">查看详情</div>
        <div id="chart4_1" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt2">
        <div class="isshowdesgin" @click="ShowDetails(2)">查看详情</div>
        <div id="chart4_2" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt3">
        <div class="isshowdesgin" @click="ShowDetails(3)">查看详情</div>
        <div id="chart4_3" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt4">
        <div class="isshowdesgin" @click="ShowDetails(4)">查看详情</div>
        <div id="chart4_4" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>
    </div>
    <div class="model_bottom">
      <div class="model_s model_bt5">
        <div class="isshowdesgin" @click="ShowDetails(5)">查看详情</div>
        <div id="chart4_5" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt6">
        <div class="isshowdesgin" @click="ShowDetails(6)">查看详情</div>
        <div id="chart4_6" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt7">
        <div class="isshowdesgin" @click="ShowDetails(7)">查看详情</div>
        <div id="chart4_7" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>

      <div class="model_s model_bt8">
        <div class="isshowdesgin" @click="ShowDetails(8)">查看详情</div>
        <div id="chart4_8" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>
      <div class="model_s model_bt9">
        <div class="isshowdesgin" @click="ShowDetails(9)">查看详情</div>
        <div id="chart4_9" v-if="state"></div>
        <!-- <div class="click_show">show</div> -->
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onBeforeUnmount } from 'vue'
const state = ref<boolean>(true);
const emit = defineEmits(['ShowDetails'])
function ShowDetails(row) {
  emit('ShowDetails', row)
}
onBeforeUnmount(() => {
  console.log("销毁")
  state.value = false;
})
</script>


<style lang="scss">
.model_ranking {
  width: 100%;
  height: calc(100% - 40px);

  // display: flex;
  // justify-content: space-around;
  // flex-wrap: wrap;
  .model_top {
    display: flex;
    height: 50%;
    width: 85%;
    margin: 0 auto;
    justify-content: space-around;

    .model_s {
      width: 25%;
      height: 100%;
      z-index: 20;
      padding-top: 15px;
      position: relative;


      div {
        width: 100%;
        height: 100%;
        margin: 0 auto;
        transition: all 0.5s;
      }

      &:hover {
        .isshowdesgin {
          opacity: 1;
        }
      }

      .isshowdesgin {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 87%;
        z-index: 15;
        width: 75%;
        left: 0;
        right: 0;
        background-color: #b8b8b82e;
        border-radius: 10px;
        cursor: pointer;
        color: #000;
        opacity: 0;
      }
    }


  }

  .model_bottom {
    display: flex;
    height: 50%;
    width: 95%;
    margin: 0 auto;

    .model_s {
      width: 20%;
      height: 100%;
      z-index: 20;
      position: relative;
      // flex: 1;
      // padding-top: 15px;

      div {
        width: 100%;
        height: 100%;
        margin: 0 auto;
      }

      &:hover {
        .isshowdesgin {
          opacity: 1;
        }
      }

      .isshowdesgin {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 95%;
        z-index: 50;
        width: 85%;
        left: 0;
        right: 0;
        background-color: #b8b8b82e;
        border-radius: 10px;
        cursor: pointer;
        color: #000;
        opacity: 0;
      }
    }
  }

}
</style>
